<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body> 
        <ui:composition template="../template.xhtml">
            <ui:define name="content">
				<h:form>
					<p:panel header="Modifica pacchetto (Step 2/2)" style="text-align:center">  
		            	<h:panelGrid columns="1" style="width:100%">  
							<h:messages />
							<h:outputLabel for="excursion" value="Scegli un'escursione" />
							<h:message for="excursion" />
							<p:selectOneListbox id="excursion" 
												value="#{packetBackend.excursion}" 
												converter="excursionConverter"
												var="excursion"
												style="height:200px;width:100%;"> 
												 
					            <f:selectItems value="#{packetBackend.excursionList}" var="excursion" itemLabel="#{excursion.productId}" itemValue="#{excursion}" />  
					  
					            <p:column>  
					                Nome: #{excursion.name} 
					            </p:column> 
					            
					            <p:column>
					            	Data: 
					            	<h:outputText value="#{excursion.date}">
									    <f:convertDateTime pattern="dd/MM/yyyy" type="date" />
									</h:outputText>
					            </p:column>  
					            
					            <p:column>
					            	#{excursion.product.price} &euro;
					            </p:column>
					  
					        </p:selectOneListbox>
					        
					        
					        <h:outputLabel for="hotel" value="Scegli un hotel" />
							<p:selectOneListbox id="hotel" 
												value="#{packetBackend.hotel}" 
												converter="hotelConverter"
												var="hotel"
												style="height:200px;width:100%;"> 
												 
					            <f:selectItems value="#{packetBackend.hotelList}" var="hotel" itemLabel="#{hotel.productId}" itemValue="#{hotel}" />  
					  
					            <p:column>  
					                #{hotel.name} (#{hotel.stars} stelle) 
					            </p:column> 
					            
					            <p:column>
					            	Dal
					            	<h:outputText value="#{hotel.checkInDate}">
									    <f:convertDateTime pattern="dd/MM/yyyy" type="date" />
									</h:outputText>
									al
					            	<h:outputText value="#{hotel.checkOutDate}">
									    <f:convertDateTime pattern="dd/MM/yyyy" type="date" />
									</h:outputText>
									
					            </p:column>  
					            
					            <p:column>
					            	#{hotel.product.price} &euro;
					            </p:column>
					  
					        </p:selectOneListbox>
					        
					        
					        
					        
					        <h:outputLabel for="flight" value="Scegli un volo" />
							<p:selectOneListbox id="flight" 
												value="#{packetBackend.flight}" 
												converter="flightConverter"
												var="flight"
												style="height:200px;width:100%;"> 
												 
					            <f:selectItems value="#{packetBackend.flightList}" var="flight" itemLabel="#{flight.productId}" itemValue="#{flight}" />  
					  
					            <p:column>  
					                Da 
					                #{flight.place.name} - 
					            	<h:outputText value="#{flight.departureDate}">
									    <f:convertDateTime pattern="dd/MM/yyyy" type="date" />
									</h:outputText>
					                 
					            </p:column> 
					            
					            <p:column>
									a
					                #{flight.product.place.name} - 
					            	<h:outputText value="#{flight.arrivalDate}">
									    <f:convertDateTime pattern="dd/MM/yyyy" type="date" />
									</h:outputText>
									
					            </p:column>  
					            
					            <p:column>
					            	#{flight.product.price} &euro;
					            </p:column>
					  
					        </p:selectOneListbox>
					       
					    	<h:commandButton value="Conferma modifiche" action="#{packetBackend.editActionStep3}" />
				
		                  
		            	</h:panelGrid>  
		        	</p:panel>  
				</h:form>            
            
            </ui:define>
        </ui:composition>

</body> 
</html>
